const express = require('express');
const router = express.Router();
const trafficController = require('../controllers/trafficController');


// 登录
router.post('/userManage/login', trafficController.login);
// 登出
router.post('/userManage/logout', trafficController.anyPost);


// lsit1
router.get('/getlsit1', trafficController.getlist1);
router.get('/getlsitMy', trafficController.getlsitMy);

router.get('/api/dashboard/drones', trafficController.getRealTimeData);
router.get('/api/history/flight-records', trafficController.getHistoryList);
router.get('/api/history/alert-records', trafficController.getAlertList);
router.get('/api/dashboard/statistics', trafficController.getPointsData);
router.get('/api/dashboard/alerts', trafficController.getPannelData);

// 用户管理相关路由
router.get('/user/list', trafficController.getUserList);
router.get('/user/detail/:id', trafficController.getUserDetail);
router.post('/user/add', trafficController.addUser);
router.put('/user/update', trafficController.updateUser);
router.put('/user/status/:id', trafficController.updateUserStatus);
router.delete('/user/delete/:id', trafficController.deleteUser);
router.put('/user/batchStatus', trafficController.batchUpdateUserStatus);

module.exports = router; 